<template>
	<!-- 商品大类 -->
	<div class="mainContent largerContainer">
		<div class="bread-nav">
			<span class="bread-item">商品管理</span>
			<span class="bread-icon">&gt;</span>
			<span class="bread-item">商品分类</span>
			<span class="bread-icon">&gt;</span>
			<span v-bind:class="[Model.tableMsg.type == 'medium' || Model.tableMsg.type == 'small' ? 'activeNavs' : '', 'bread-item']"
			 @click="toLarge()">商品大类</span>
			<!--  -->
			<a v-if="Model.tableMsg.type == 'medium' || Model.tableMsg.type == 'small'">
				<span class="bread-icon">&gt;</span>
				<span v-bind:class="[Model.tableMsg.type == 'small' ? 'activeNavs' : '', 'bread-item']" @click="toMedium()">商品中类</span>
			</a>
			<!--  -->
			<a v-if="Model.tableMsg.type == 'small'">
				<span class="bread-icon">&gt;</span>
				<span class="bread-item">商品小类</span>
			</a>
		</div>
		<!--  -->
		<div class="largerContant">
			<!-- table  -->
			<div class="after-sale-table">
				<el-row>
					<div class="common-table-title">
						<div class="common-table-icon"></div>
						<div class="common-table-fl">{{Model.tableMsg.title}}</div>
					</div>
				</el-row>
				<!--  -->
				<el-row class="common-table-con">
					<el-table stripe :data="Model.tableData" max-height="500">
						<el-table-column align="center" v-for="(item,index) in Model.tableHeaderData" v-if="item.prop == 'quantity' "
						 :key="item.prop" :prop="item.prop" :label="item.label" :width="item.width">
							<template slot-scope="scope">
								<el-button type="text" @click="handleClickItem(scope.row)"><a class="detial-link">{{scope.row.quantity}}</a></el-button>
							</template>
						</el-table-column>
						<el-table-column align="center" v-else :key="item.prop" :prop="item.prop" :label="item.label" :width="item.width">
						</el-table-column>
					</el-table>
					<!-- 分页 -->
					<!-- 产品需求大类不需要分页，中类和小类则需要 -->
					<el-row class="pagination-cont" v-if="Model.tableMsg.isPrev">
						<el-pagination @size-change="handleSizeChange" background @current-change="handleCurrentChange" :current-page="Model.paginationObject.currentPage"
						 :page-sizes="[10, 20, 30, 40]" :pager-count="5" :page-size="Model.paginationObject.pageSize" layout="sizes, prev, pager, next, jumper, slot"
						 :total="Model.paginationObject.total">
							<div class="pagination-slot">
								显示
								<p class="slot-i">{{Model.paginationObject.num1}}</p>
								到
								<p class="slot-i">{{Model.paginationObject.num2}}</p>
								，共
								<p class="slot-i">{{Model.paginationObject.total}}</p>
								记录
							</div>
						</el-pagination>
					</el-row>
				</el-row>
			</div>
			<!-- table end -->
		</div>
	</div>
</template>

<script>
	import Model from './model.js'
	import Controller from './controller.js'
	export default {
		name: 'larger',
		mixins: [Model, Controller],
		components: {

		},
		props: [
			''
		],
		created() {
			this.init();
		},
		mounted() {

		},
	}
</script>

<style scoped lang="less">
	@import "./index.less";
</style>
